﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace WPF_DbCenter.GlobalDefine
{

    public static class NoLenghtType
    {
        private static List<string> coll=new List<string>();
        public static List<string> Collections
        {
            get
            {
                if (coll.Count == 0)
                {
                    coll.Add("int");
                    coll.Add("integer");
                    coll.Add("smallint");
                    coll.Add("byte");
                    coll.Add("double");
                    coll.Add("decimal");
                    coll.Add("datetime");
                    coll.Add("money");
                    coll.Add("bool");
                    coll.Add("bigint");
                    coll.Add("tinyint");
                }
                return coll;
            }
        }

    }

    public enum SupportedDbType
    {
        SqlServer,
        MySql,
        OleDb,
        SqlCe,
        Oracle,
        None,
    };

    public class DbTypeCollection
    {
        public int SortIndex { get; set; }

        public string DisplayName { get; set; }

        public SupportedDbType MyType { get; set; }

        public string MainUI_URI { get; set; }

        public override string ToString()
        {
            return DisplayName;
        }
    }

    public class MyDefine
    {
        
        //public static SupportedDbType CurDbType { get; set; }

        public MyDefine()
        {
                
        }

        public static DbTypeCollection CurSelectedCollectin { get; set; }

        public static List<DbTypeCollection> CurDbCollection
        {
            get
            {
                List<DbTypeCollection> curList = new List<DbTypeCollection>();
                curList.Add(new DbTypeCollection()
                {
                    DisplayName = "Sql CE",
                    MyType = SupportedDbType.SqlCe,
                    MainUI_URI = "SqlCE\\SqlCeMain.xaml",
                    SortIndex = 1
                });

                curList.Add(new DbTypeCollection()
                {
                    DisplayName = "Sql Server",
                    MyType = SupportedDbType.SqlServer,
                    MainUI_URI = "SqlServer\\SqlServerMain.xaml",
                    SortIndex = 2
                });

                curList.Add(new DbTypeCollection()
                {
                    DisplayName = "My Sql",
                    MyType = SupportedDbType.MySql,
                    SortIndex = 3
                });
                curList.Add(new DbTypeCollection()
                {
                    DisplayName = "Ole Db",
                    MyType = SupportedDbType.OleDb,
                    MainUI_URI = "OleDb\\OleDbMain.xaml",
                    SortIndex = 4
                });

                curList.Add(new DbTypeCollection()
                {
                    DisplayName = "Oracle",
                    MyType = SupportedDbType.Oracle,
                    SortIndex = 5
                });

                return curList;
            }
        }
    }
}
